package com.xd.core.business.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 授信表
 * </p>
 *
 * @author ZX
 * @since 2025-02-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Credit对象", description = "授信表")
public class Credit implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "credit_id", type = IdType.AUTO)
    @ApiModelProperty(value = "授信ID")
    private Integer creditId;

    @ApiModelProperty(value = "授信金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "剩余授信额度")
    private BigDecimal amountRest;

    @ApiModelProperty(value = "授信起始日期")
    @JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty(value = "授信到期日期")
    @JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date expireTime;

    @ApiModelProperty(value = "罚款利率%")
    private BigDecimal penaltyRate;

    @ApiModelProperty(value = "借款人账户名")
    private String accountName;

    @ApiModelProperty(value = "借款人收款账户")
    private String receivingAccount;

    @ApiModelProperty(value = "借款人开户银行")
    private String bank;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "授信人ID")
    private Integer userId;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "进件单号")
    private Integer incomingId;

    @ApiModelProperty(value = "授信状态(0--等待授信,1--授信失败,2--授信成功)")
    private String status;

    @ApiModelProperty(value = "还款账号")
    private String repayAccount;

    @ApiModelProperty(value = "还款开户行")
    private String repayBank;

    @ApiModelProperty(value = "还款账户名")
    private String repayName;

    @ApiModelProperty(value = "绑卡状态(0--未绑定,1--已绑定)")
    private String cardStatus;

    @ApiModelProperty(value = "报文流水号")
    private String msgId;

    @ApiModelProperty(value = "资方id")
    private Integer companyId;

    @TableField(exist = false)
    @ApiModelProperty(value = "订单状态(0--启用,1--停用)")
    private String isEnable;

    @ApiModelProperty(value = "银行预留手机号")
    private String bankPhone;

    @ApiModelProperty(value = "被保险人姓名")
    private String insuredName;

    @ApiModelProperty(value = "开户行支行全称")
    private String bankBranch;

    @ApiModelProperty(value = "保司所在省市坐标")
    private String insuranceSqes;

    @ApiModelProperty(value = "保司所在省市id")
    private String insuranceCity;

    @ApiModelProperty(value = "保险种类（0--车险，1--工程机械保险）")
    private String insuranceType;

    @ApiModelProperty(value = "商业保险总金额")
    private BigDecimal insuranceAmount;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "代缴其他保费金额")
    private BigDecimal otherAmount;

    @ApiModelProperty(value = "借款期数")
    private Integer term;

    @ApiModelProperty(value = "每月还款日")
    private String repayDay;

    @ApiModelProperty(value = "收费模式（0--前置，1--后置，2--前置+后置）")
    private String chargeModel;

    @ApiModelProperty(value = "借款方式（0--等额本金，1--等额本息，2--等本等息）")
    private String loanMethod;

    @ApiModelProperty(value = "预付款支付方式(0--银行转账，1--银行代扣)")
    private String payType;

    @ApiModelProperty(value = "首付比例（单位：%）")
    private BigDecimal downRepaymentRate;

    @ApiModelProperty(value = "首付金额（单位：元）")
    private BigDecimal downRepaymentAmount;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "前置服务费率（单位：%）")
    private BigDecimal preServiceFeeRate;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "后置服务费率（单位：%）")
    private BigDecimal postServiceFeeRate;
    @ApiModelProperty(value = "综合年华利率（单位：%）")
    private BigDecimal rate;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "前置服务费")
    private BigDecimal preServiceFee;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "后置服务费")
    private BigDecimal postServiceFee;

    @ApiModelProperty(value = "借款金额")
    private BigDecimal loanAmount;

    @ApiModelProperty(value = "预付款总金额")
    private BigDecimal advanceAmount;

    @ApiModelProperty(value = "特约退保要求（0--按天退保，1--按月退保或未列明,2--无）")
    private String refundRequest;

    @ApiModelProperty(value = "缴费通知书")
    private String paymentInstructions;

    @ApiModelProperty(value = "挂靠协议")
    private String hangingAgreement;

    @ApiModelProperty(value = "其他资料")
    private String otherAnnex;

    @ApiModelProperty(value = "还款频率(0--天,1--月,2--周)")
    private String repayFrequency;

}
